package com.le.t1;

import com.le.t1.jie.imp.personjimp;
import com.le.t1.jie.personj;

import java.io.IOException;
import java.io.ObjectInputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class Serverzc {

    ServerSocket serverSocket;
    Socket socket;
    person person;
    personj personj;
    public Serverzc() throws Exception {

        while (true) {
             serverSocket = new ServerSocket(9999);
            socket = serverSocket.accept();

            ObjectInputStream in = new ObjectInputStream(socket.getInputStream());

             person = (com.le.t1.person) in.readObject();

            personj = new personjimp();
            personj.insert(person);

            in.close();
            socket.close();
            serverSocket.close();
        }


    }

    public static void main(String[] args) throws Exception {
        new Serverzc();
    }
}
